package com.xcc.feign;

import com.xcc.common.domain.entry.User;
import com.xcc.common.result.ResultBody;
import com.xcc.error.UserErrorService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author frosty
 * @description user 服务接口
 * @date 2019-11-20 20:10:33
 */

 /*这里不加@Component*/
@FeignClient(value = "USER-SERVER",fallback = UserErrorService.class)
public interface UserFeignService {
    @PostMapping("/register")
     ResultBody register(@RequestParam("user") User user);

     @GetMapping(value = "/getU")
      ResultBody getU();

     @GetMapping("/list")
     ResultBody list(@RequestParam(required = false) Map<String ,Object> map);

      @GetMapping("/find/{id}")
      ResultBody find(@PathVariable("id") String id );

      @PostMapping("/update")
      ResultBody update(@RequestParam("user") User user);

      @GetMapping("/delete/{id}")
      ResultBody delete(@PathVariable("id")String id);
       @GetMapping("/login")
      ResultBody login(@RequestParam("username")String username,@RequestParam("password")String password);




}
